package me.shiqiang.im.service;

import me.shiqiang.im.microservice.GroupClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author John
 * @date 2018/5/9 下午2:33
 */
@Service
@CacheConfig(cacheNames = "noDisturb")
public class GroupService {

    @Autowired
    GroupClient groupClient;

    @Cacheable(key = "'uid' + #userId  + 'session'+ #sessionId + 'ctype'+#ctype")
    public boolean isNoDisturb(Long userId, Long sessionId, int ctype){
        return groupClient.isNoDisturb(userId, sessionId, ctype);
    }

}
